#include <iostream>
#include <string>
class Sales_data {
  std::string bookNo;
  unsigned units_sold;
  double revenue;
  double avg_price() const { return units_sold ? revenue / units_sold : 0; }

 public:
  Sales_data(const std::string &s = std::string(), unsigned n = 0, double p = 0)
      : bookNo(s), units_sold(n), revenue(p) {}
  Sales_data(std::istream &is);
  std::string isbn() const { return bookNo; }
  Sales_data &operator+=(const Sales_data &s);
  friend std::hash<Sales_data>;
  friend std::ostream &operator<<(std::ostream &os, const Sales_data &s);
  friend std::istream &operator>>(std::istream &is, Sales_data &s);
  friend bool operator==(const Sales_data &ls, const Sales_data &rs);
  friend Sales_data operator+(const Sales_data &ls, const Sales_data &rs);
  friend std::ostream &print(std::ostream &os, const Sales_data &s);
  friend std::istream &read(std::istream &is, Sales_data &s);
};
bool operator!=(const Sales_data &ls, const Sales_data &rs);
Sales_data add(const Sales_data &ls, const Sales_data &rs);

namespace std {
template <>
struct hash<Sales_data> {
  typedef size_t result_type;
  typedef Sales_data argument_type;
  size_t operator()(const Sales_data &s) const {
    return hash<string>()(s.bookNo) ^ hash<unsigned>()(s.units_sold) ^
           hash<double>()(s.revenue);
  }
};
}  // namespace std